package cn.fancy.sdk.entity;

import android.content.Context;
import android.content.SharedPreferences;

public class SdkBaseInfo 
{   
	
	
	public static boolean isThirdPartyAccount = false;
	
	public static int sdkVersion=41110;
	
	public static int USED_ACCOUNTS = 0;
	
	
    public static String getServQQ(Context context) {
		
		return getStringInfoFromXml(context,"a");
	}

	public static String getServEmail(Context context) {
		
		return getStringInfoFromXml(context,"b");
	}
	
	public static String getServTel(Context context) {
		
		return getStringInfoFromXml(context,"c");
	}
	
	public static String getBbsUrl(Context context){
	
		return getStringInfoFromXml(context,"d");
	}
	
	public static String getBackPwdSms(Context context) {
		
		return getStringInfoFromXml(context,"e");
	}
	
	public static String getBackPwdSpNumber(Context context) {
		
		return getStringInfoFromXml(context,"f");
	}
	
	public static String getUserAgreementUrl(Context context) {
	
		return getStringInfoFromXml(context,"g");
	}
	
	public static int getShowMoregame(Context context) {
		
		return getIntInfoFromXml(context,"h");
	}
	
	public static String getChargeTel(Context context) {
		
		return getStringInfoFromXml(context,"m");
	}

	public static String getChargeQQ(Context context) {
		
		return getStringInfoFromXml(context,"n");
	}

	public static String getChargeEmail(Context context ) {
		
		return getStringInfoFromXml(context,"o");
	}
	
    public static String getCanUseTelecomChargePaymentIds(Context context) {
		
		return getStringInfoFromXml(context,"s");
	}
	
	public static String getStringInfoFromXml(Context context,String key){
		  
		    String info = "";
			
			if(context!=null)
			{
				SharedPreferences sp = context.getSharedPreferences("csdkbaseinfo", Context.MODE_PRIVATE);
				
				if(sp!=null)
				{
					info = sp.getString(key, "");
				}
			}
			
          return info;
	}
	
	public static int getIntInfoFromXml(Context context,String key){
		
		 int info = Integer.MIN_VALUE;
			
		  if(context!=null)
		  {
				SharedPreferences sp = context.getSharedPreferences("csdkbaseinfo", Context.MODE_PRIVATE);
				
				if(sp!=null)
				{
					info = sp.getInt(key,Integer.MIN_VALUE);
				}
		  }
			
          return info;
	}
	
}
